/***************************************************************************//**
 * @file CGI/Scenery.cpp
 * @author  Marek M. Cel <marekcel@mscsim.org>
 *
 * @section LICENSE
 *
 * Copyright (C) 2013 Marek M. Cel
 *
 * This file is part of MScSim. You can redistribute and modify it under
 * the terms of GNU General Public License as published by the Free Software
 * Foundation; either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Further information about the GNU General Public License can also be found
 * on the world wide web at http://www.gnu.org.
 ******************************************************************************/
#ifndef SCENERY_CPP
#define SCENERY_CPP
#endif

////////////////////////////////////////////////////////////////////////////////

#include <CGI/Scenery.h>

////////////////////////////////////////////////////////////////////////////////

Scenery::Scenery( CGI_Data *data ) :
    m_data ( data ),

    m_terrain ( 0 ),
    m_airport ( 0 )
{
    m_sceneryGroup = new osg::Group();
    m_sceneryGroup->setName( "SceneryGroup" );

    m_terrain = new Terrain( m_data );
    m_airport = new Airport( m_data );

    m_sceneryGroup->addChild( m_terrain->getTerrainGroup().get() );
    m_sceneryGroup->addChild( m_airport->getAirportGroup().get() );
}

////////////////////////////////////////////////////////////////////////////////

Scenery::~Scenery()
{
    if ( m_terrain ) delete m_terrain; m_terrain = 0;
    if ( m_airport ) delete m_airport; m_airport = 0;
}

////////////////////////////////////////////////////////////////////////////////

void Scenery::update()
{
    m_terrain->update();
    m_airport->update();
}

